package basic50.fiftieth;

import java.util.Scanner;

public class Basic46 {
    public static void main(String[] args) {
        //题目：两个字符串连接程序
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();

        long l1 = System.nanoTime();
        connect(s1,s2);
        long l2 = System.nanoTime();
        System.out.println(l2-l1);

        long l3 = System.nanoTime();
        System.out.println(s1.concat(s2));
        long l4 = System.nanoTime();
        System.out.println(l4-l3);


        long l5 = System.nanoTime();
        String string = s1 + s2;
        System.out.println(string);
        long l6 = System.nanoTime();
        System.out.println(l6-l5);
    }

    private static void connect(String s1, String s2) {
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(s1);
        stringBuilder.append(s2);
        System.out.println(stringBuilder);
    }
}
